package com.ruoyi.teach.service.impl;

import java.util.List;

import com.ruoyi.teach.domain.NbChapterMaterialVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbChapterMaterialMapper;
import com.ruoyi.teach.domain.NbChapterMaterial;
import com.ruoyi.teach.service.INbChapterMaterialService;

/**
 * 章节/学习资料Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbChapterMaterialServiceImpl implements INbChapterMaterialService 
{
    @Autowired
    private NbChapterMaterialMapper nbChapterMaterialMapper;

    /**
     * 查询章节/学习资料
     * 
     * @param id 章节/学习资料主键
     * @return 章节/学习资料
     */
    @Override
    public NbChapterMaterial selectNbChapterMaterialById(Long id)
    {
        return nbChapterMaterialMapper.selectNbChapterMaterialById(id);
    }

    /**
     * 查询章节/学习资料列表
     * 
     * @param nbChapterMaterial 章节/学习资料
     * @return 章节/学习资料
     */
    @Override
    public List<NbChapterMaterial> selectNbChapterMaterialList(NbChapterMaterial nbChapterMaterial)
    {
        return nbChapterMaterialMapper.selectNbChapterMaterialList(nbChapterMaterial);
    }

    /**
     * 新增章节/学习资料
     * 
     * @param nbChapterMaterial 章节/学习资料
     * @return 结果
     */
    @Override
    public int insertNbChapterMaterial(NbChapterMaterial nbChapterMaterial)
    {
        return nbChapterMaterialMapper.insertNbChapterMaterial(nbChapterMaterial);
    }

    /**
     * 修改章节/学习资料
     * 
     * @param nbChapterMaterial 章节/学习资料
     * @return 结果
     */
    @Override
    public int updateNbChapterMaterial(NbChapterMaterial nbChapterMaterial)
    {
        return nbChapterMaterialMapper.updateNbChapterMaterial(nbChapterMaterial);
    }

    /**
     * 批量删除章节/学习资料
     * 
     * @param ids 需要删除的章节/学习资料主键
     * @return 结果
     */
    @Override
    public int deleteNbChapterMaterialByIds(Long[] ids)
    {
        return nbChapterMaterialMapper.deleteNbChapterMaterialByIds(ids);
    }

    /**
     * 删除章节/学习资料信息
     * 
     * @param id 章节/学习资料主键
     * @return 结果
     */
    @Override
    public int deleteNbChapterMaterialById(Long id)
    {
        return nbChapterMaterialMapper.deleteNbChapterMaterialById(id);
    }

    @Override
    public List<NbChapterMaterialVo> files(NbChapterMaterial nbChapterMaterial) {
        return nbChapterMaterialMapper.files(nbChapterMaterial);
    }
}
